package mediaplayer;

import uk.co.caprica.vlcj.component.EmbeddedMediaListPlayerComponent;
import uk.co.caprica.vlcj.player.embedded.EmbeddedMediaPlayer;

import javax.swing.*;
import java.awt.*;

/*
 * 
 */
public class MainUI extends JFrame {

    EmbeddedMediaListPlayerComponent playcomponent;

    public EmbeddedMediaPlayer mp;

    public MainUI() {

        playcomponent = new EmbeddedMediaListPlayerComponent();

        mp = playcomponent.getMediaPlayer();

        this.setTitle("多功能播放器"); // 给窗口设置标题

        this.setSize(400, 500);  //给窗体设置大小

        //　设施窗体关闭时退出
        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        northPanel();
        this.setVisible(true);  //设置窗体可见
    }

    public void northPanel() {
        JPanel north = new JPanel();

        north.setLayout(new BorderLayout());

        //
        north.add(northNorthPanel());  //将北部的北部面

        north.add(northCenterProgressBar());
        this.add(north, BorderLayout.NORTH);

    }

    /**
     *
     * @return
     */
    public JPanel northNorthPanel() {
        JPanel northnorth = new JPanel();

        northnorth.add(new JButton("开始"));

        northnorth.add(new JButton("暂停"));

        northnorth.add(new JButton("停止"));

        return northnorth;

    }

    public JProgressBar northCenterProgressBar() {
        JProgressBar progress = new JProgressBar();


        return progress;

    }

    public void centerPanel() {
        this.add(playcomponent);
    }

}
